package net.zoneland.geological.system.entity;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class ZTreeEntity implements Serializable { 

	private static final long serialVersionUID = 1L;
	
	private String id = null;
	
	private String name = null;
	
	private String p_code = null;
	
	private String code = null;
	
	private Integer level = 1;
	
	private String iconSkin = "myTree-level1";
	
	private Boolean open = false;
	
	private Boolean isParent = true;
	
	private List<ZTreeEntity> children = null;
	
	public ZTreeEntity(){}	
	
	public ZTreeEntity( String id, String name, String code, String p_code, Integer level, String iconSkin, Boolean open, List<ZTreeEntity> children ) {
		super();
		this.id = id;
		this.name = name;
		this.code = code;
		this.p_code = p_code;
		this.level = level;
		this.iconSkin = iconSkin;
		this.open = open;
		this.children = children;
	}

	public String getName() {
		return name;
	}
	public String getIconSkin() {
		return iconSkin;
	}
	public Boolean getOpen() {
		return open;
	}
	public List<ZTreeEntity> getChildren() {
		return children;
	}
	public void setName(String name) {
		this.name = name;
	}
	public void setIconSkin(String iconSkin) {
		this.iconSkin = iconSkin;
	}
	public void setOpen(Boolean open) {
		this.open = open;
	}
	public void setChildren(List<ZTreeEntity> children) {
		this.children = children;
	}
	public void addChild(ZTreeEntity child) {
		if( this.children == null ) {
			this.children = new ArrayList<>();
		}
		this.children.add( child );
	}

	public String getCode() {
		return code;
	}

	public Integer getLevel() {
		return level;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public void setLevel(Integer level) {
		this.level = level;
	}

	public String getP_code() {
		return p_code;
	}

	public void setP_code(String p_code) {
		this.p_code = p_code;
	}

	public Boolean getIsParent() {
		return isParent;
	}

	public void setIsParent(Boolean isParent) {
		this.isParent = isParent;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}
	
}
